﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace jnxc.Web.product
{
    public partial class Show : Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    int pid = (Convert.ToInt32(strid));
                    ShowInfo(pid);
                }
            }
        }

        private void ShowInfo(int pid)
        {
            jnxc.BLL.product bll = new jnxc.BLL.product();
            DataSet ds = bll.GetPro(pid);
            if (ds.Tables[0].Rows.Count == 1)
            {
                this.lblcid.Text = ds.Tables[0].Rows[0]["cname"].ToString();
                this.lblpname.Text = ds.Tables[0].Rows[0]["pname"].ToString();
                this.lblppara.Text = ds.Tables[0].Rows[0]["ppara"].ToString();
                this.lblpcontent.Text = ds.Tables[0].Rows[0]["pcontent"].ToString();
                string value=ds.Tables[0].Rows[0]["pstate"].ToString();
                string re="";
                if (value=="0") {
                                re="未审核";
                            } else if (value == "1") {
                                re="审核通过";
                            } else if (value == "2") {
                                re= "审核未通过";
                            }
                this.lblpstate.Text =re ;
                imgpic.ImageUrl = ds.Tables[0].Rows[0]["ppic"].ToString();
            }

        }

        protected void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
